#include <rtthread.h> 
#include <rtdevice.h>  
//#include "drv_lcd.h"
#include "littlevgl2rtt.h" 

//#include "lvgl_demo.h"
#include "lv_test_theme.h"

#include "mainpage.h"

void lvgl_task_run(void *p)
{
	lvgl_init();
	
	rt_thread_mdelay(10);

	//lvgl_demo();
	
	// MAIN_PAGE_T * main_page_create(void);
	// main_page_create();
    
	// void lv_demo_benchmark(void);
	// lv_demo_benchmark();
	
	void lv_demo_printer(void);
	lv_demo_printer();
	
	lvgl_run(); //loop
	lvgl_deinit();
} 

int lvgl_task_startup(void)
{
    rt_err_t ret = RT_EOK;
    rt_thread_t thread = RT_NULL;

    /* littleGL demo gui thread */ 
    thread = rt_thread_create("lv_task", lvgl_task_run, RT_NULL, 10*1024, 10, 20); 
    if(thread == RT_NULL)
    {
        return RT_ERROR;
    }
    rt_thread_startup(thread);

    return RT_EOK; 
}
//INIT_APP_EXPORT(lvgl_task_startup); 
